package com.example.util;

import android.renderscript.RenderScript;

/**
 * 带有优先级的Runnable类型
 * @author chaohaipeng  on 2018/3/23.
 */

public class PriorityRunnable implements Runnable{
    public final RenderScript.Priority priority;//任务优先级
    private final Runnable runnable;//任务真正执行者
    /*package*/ long SEQ;//任务唯一标示

    public PriorityRunnable(RenderScript.Priority priority, Runnable runnable) {
        this.priority = priority == null ? RenderScript.Priority.NORMAL : priority;
        this.runnable = runnable;
    }

    @Override
    public final void run() {
        this.runnable.run();
    }
}
